home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / ZTIMER11.ARJ / MAKEFILE < prev    next >
Text File  |  1992-04-21  |  4KB  |  137 lines

  1. #############################################################################
  2. #
  3. #                                 Zen Timer
  4. #
  5. #                               From the book
  6. #                         "Zen of Assembly Language"
  7. #                            Volume 1, Knowledge
  8. #
  9. #                             by Michael Abrash
  10. #
  11. #                    Makefile for a memory model indepedant
  12. #                    'C' callable library by Kendall Bennett
  13. #
  14. # Descripton:    Makefile for the Zen Timer library.
  15. #
  16. # $Id: makefile 1.9 92/04/21 01:36:51 kjb Exp $
  17. #
  18. #############################################################################
  19.  
  20. # Turn on autodependency checking
  21.  
  22. .AUTODEPEND
  23.  
  24. # Let make know where to find all the appropriate files
  25.  
  26. .PATH.asm       = .
  27. .PATH.lib       = \bc\lib\mylib
  28. .PATH.obj       = .
  29. .PATH.exe       = .
  30.  
  31. # These directives will need to be modified for your particular setup.
  32. # Currently the are set for use with Borland C++ 3.0 installed in
  33. # the directory "BC" rather than "BORLANDC" as is the default.
  34.  
  35. CC              = bcc               # Name of C compiler
  36. ASM             = tasm              # Name of assembler
  37. LINK            = tlink             # Name of linker
  38. LIB             = tlib              # Name of librarian
  39. LIB_FLAGS       = /C /E
  40.  
  41. # This will need to be changed to your normal include file directory
  42.  
  43. INC_DEST        = \bc\include\myinc
  44.  
  45. LIBNAME         = ztimer_           # Name of library file to create
  46.  
  47. !if $d(debug)
  48. CC_DOPT         = -v                # Turn on debugging for C compiler
  49. ASM_DOPT        = /ZI               # Turn on debugging for assembler
  50. !endif
  51.  
  52. # Set up memory model macros depending on version we are making
  53.  
  54. !if $d(medium)
  55. MODEL           = m
  56. ASM_MODEL       = /d__MEDIUM__
  57. !elif $d(compact)
  58. MODEL           = c
  59. ASM_MODEL       = /d__COMPACT__
  60. !elif $d(large)
  61. MODEL           = l
  62. ASM_MODEL       = /d__LARGE__
  63. !elif $(huge)
  64. MODEL           = h
  65. ASM_MODEL       = /d__HUGE__
  66. !else
  67. MODEL           = s                 # Default to small model
  68. ASM_MODEL       = /d__SMALL__
  69. !endif
  70.  
  71. LIBFILE         = $(.PATH.lib)\$(LIBNAME)$(MODEL).lib
  72. ASM_FLAGS       = /MX /m /O /i$(.PATH.asm) $(ASM_DOPT) $(ASM_MODEL)
  73. CC_FLAGS        = -m$(MODEL) $(CC_DOPT)
  74.  
  75. # Implicit rules to make the object files for the library...
  76.  
  77. .cpp.obj:
  78.     $(CC) $(CC_FLAGS) -c {$< }
  79.      
  80. .c.obj:
  81.     $(CC) $(CC_FLAGS) -c {$< }
  82.      
  83. .asm.obj:
  84.     $(ASM) $(ASM_FLAGS) $<, $&
  85.  
  86. # Object files required by the library
  87.  
  88. OBJECTS         = pztimer.obj lztimer.obj ztimer.obj ulztimer.obj
  89.  
  90. all: $(LIBFILE) install_inc
  91.  
  92. # Just build the library, don't install the header files
  93.  
  94. build: $(LIBFILE)
  95.  
  96. $(LIBFILE): $(OBJECTS)
  97.     buildrsp &&!|
  98.     $(OBJECTS)
  99. !   > ztimer.rsp
  100.     $(LIB) $(LIB_FLAGS) $< @ztimer.rsp
  101.     del ztimer.rsp
  102.  
  103. install_inc:
  104.     @copy ztimer.h debug.h $(INC_DEST)
  105.  
  106. # Clean up directory removing all files not needed to make the library.
  107. # This works for 4Dos 4.0. If you are running under MS DOS, you will
  108. # probably need to change this to delete each file type separately.
  109.  
  110. clean:
  111.     @del *.obj *.sym *.bak *.exe *.tdk
  112.     @del $(.PATH.lib)\*.bak
  113.     @del ztimer.zip
  114.  
  115. stamp:
  116.     @foreach "rcs -srelease" files.lst
  117.  
  118. rcsclean:
  119.     @foreach rcsclean files.lst
  120.  
  121. # Check in the latest revisions of source files with RCS
  122.  
  123. ci:
  124.     @foreach "ci -q -u $(RCSOPT)" files.lst
  125.  
  126. # Check out the latest revisions of source files from RCS
  127.  
  128. co:
  129.     @foreach "co -q $(RCSOPT)" files.lst
  130.  
  131. # Create a distribution zip file
  132.  
  133. zip: clean
  134.     copy $(.PATH.lib)\$(LIBNAME)?.lib .
  135.     pkzip -rp -xrcs\*.* -xfiles.lst ztimer.zip *.*
  136.  
  137.